var net = require('net');
var ChatSever = net.createServer();
clientList = [];
ChatSever.on('connection', function(client) {
    clientList.push(client);
    client.write('Welcome to guoxuri chat server...\n\r');
    client.on("data", function(data) {
        for (var i = 0; i < clientList.length; i++) {
            if (client != clientList[i]) {
                clientList[i].write(data);
            }
        }
    });
});
ChatSever.listen(9000);